<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // 也可以用这种方式创建对象,等价于var obj = new Object ();
        var obj = { };
        obj.name = "孙悟空";
        // 可以在{}里面增加属性
        alert(obj.name);
        var obj1 = {
            name:"张三",
            age:18
        };
        document.write(obj1.name);
    </script>
</head>
<body>
    
</body>
</html>